import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/views/Index'
import Category from '@/views/Category'
import Cart from '@/views/Cart'
import Order from '@/views/Order'
import User from '@/views/User'
import Login from '@/views/Login'
import Register from '@/views/Register'
import Product from '@/views/Product'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Index,
      meta: { keepAlive: true }
    },
    {
      path: '/category',
      component: Category,
      meta: { keepAlive: true }
    },
    {
      path: '/cart',
      component: Cart,
      meta: { keepAlive: true }
    },
    {
      path: '/user',
      component: User,
      meta: { keepAlive: false }
    },
    {
      path: '/login',
      component: Login,
      meta: { keepAlive: true }
    },
    {
      path: '/register',
      component: Register,
      meta: { keepAlive: false }
    },
    {
      path: '/order',
      component: Order,
      meta: { keepAlive: true }
    },
    {
      path: '/product/:pid',
      component: Product,
      meta: { keepAlive: false }
    }
  ]
})
